using TMPro;
using TMPro.EditorUtilities;
using UnityEditor;
using UnityEngine.UI;

namespace Runtime.Module.GameGraphic.Editor
{
    [CustomEditor(typeof(TextMeshProUGUI), true),CanEditMultipleObjects]
    public class CustomTextMeshProUGUIEditor : TMP_EditorPanelUI
    {
        IsScriptCtrlEditorData<TextMeshProUGUI> isScriptCtrlEditorData;


        protected override void OnEnable()
        {
            base.OnEnable();
            isScriptCtrlEditorData =
                new IsScriptCtrlEditorData<TextMeshProUGUI>(serializedObject, (TextMeshProUGUI)target);
        }

        protected override void OnDisable()
        {
            base.OnDisable();
            isScriptCtrlEditorData = null;
        }


        // public override void SaveChanges()
        // {
        //     base.SaveChanges();
        // }

        public override void OnInspectorGUI()
        {
            isScriptCtrlEditorData.OnInspectorGUIOfScript();
            base.OnInspectorGUI();
        }
    }
}